<?php
class cityfranPlugin{
    var $ld;
    var $xmlsOb;
    var $myNeighbor;
    var $myFranchise;
    var $arOrderedF;
    var $validType;
    var $fcndata;
    var $allTypes;
    var $allItems;
    var $defaultsel;
    var $vtype_b;
    var $valltype_b;
    var $xmlsFName;
    function cityfranPlugin(){
      $this->ld=new LocalData();
      $this->xmlsOb=new xmlsOb();
      $this->myNeighbor=array();
      $this->myFranchise=array();
      $this->arOrderedF=array();
      $this->validType=array('business', 'residence', 'decoration', 'municipal', 'landmark', 'wonder', 'storage',);
      $this->vtype_b=array('mall','bridge','holidaytree','hotel','socialbusiness','neighborhood','attraction');
      $this->valltype_b=$this->rnT();
      $this->defaultsel='landmark';
      $this->fcndata=array();
      $this->allTypes='';
      $this->allItems=array();
      $xmlsFNameObj=new cfxmlsLang();
      $this->xmlsFName=$xmlsFNameObj->langXML;
    }
    function nN($zuid){
      $ownername='unknownCity';
      if(isset($this->myNeighbor[$zuid])&&(!empty($this->myNeighbor[$zuid]))){$ownername=$this->myNeighbor[$zuid];}
      return $ownername;
    }
    function rnT(){
      if(file_exists(cityfran_DIR."Types.txt")){
        $newtypes=file(cityfran_DIR."Types.txt", FILE_SKIP_EMPTY_LINES||FILE_IGNORE_NEW_LINES);
        if(($newtypes === false)||(!is_array($newtypes))||empty($newtypes)){$newtypes=$this->vtype_b;}
        else{
          $pnt=array();
          foreach ($newtypes as $t){
            $st=trim($t);
            if((!in_array($st, $this->vtype_b))&&!empty($st)){$pnt[]=$st;}
          }
          $newtypes=array_merge($pnt, $this->vtype_b);
        }
      }
      else{
      	$snewtypes=''; foreach ($this->vtype_b as $t){$snewtypes .= $t."\n";}
      	file_put_contents(cityfran_DIR."Types.txt", $snewtypes);
      	$newtypes=$this->vtype_b;
      }
      return $newtypes;
    }
    function aT($newT){
      if(isset($newT)&&!empty($newT)){
        if(isset($newT->newtype)&&!empty($newT->newtype)){
          $snt=(string)$newT->newtype;
          if(!in_array($snt, $this->valltype_b)){
            $snewtypes=$snt."\n"; foreach ($this->valltype_b as $t){$snewtypes .= $t."\n";}
      	    file_put_contents(cityfran_DIR."Types.txt", $snewtypes);
          }
        }
      }
    }
    function rT(){
      $snewtypes=''; foreach ($this->vtype_b as $t){$snewtypes .= $t."\n";}
      file_put_contents(cityfran_DIR."Types.txt", $snewtypes);
      $newtypes=$this->vtype_b;
    }
    function iE($itemCode){
      foreach ($this->xmlsOb->gsXML->items->item as $item){if(strcasecmp($itemCode, $item['name'])==0){return $item;}}
      return false;
    }
    function flN($item){
      if(!isset($this->xmlsFName)||empty($this->xmlsFName)) return '';
      if(isset($this->xmlsFName[$item])&&(!empty($this->xmlsFName[$item]))){return ((string)$this->xmlsFName[$item]);}else{return '';}
    }
    function idxVT($stype){
      $ltype=(string)$stype;if(in_array($ltype, $this->validType)){return $ltype;}else if(in_array($ltype, $this->valltype_b)){return 'b_others';} else{return 'i_others';}
    }
    function isVO($item){
      if((($item['giftable']=='true')||($item['requestable']=='true')||($item['requestOnly']=='true')||(in_array($item['type'], array('tool','xgamegift','quest_item'))))&&(!in_array($item['type'], array('none')))){return true;}
      return false;
    }
    function GAI(){
      $iList=array();
      $iDerivesFrom=array();
      unset($this->allItems);
      $this->allItems='';
      foreach ($this->validType as $vtype){$iList[$vtype]=array();}
      $iList['b_others']=array();
      $iList['i_others']=array();
      $keycnt=0;
      foreach ($this->xmlsOb->gsXML->items->item as $item){
      	$iType='';
      	if(isset($item['type'])){$iType=$this->idxVT($item['type']);}elseif(isset($item['derivesFrom'])){$iDerivesFrom[]=$item;}
      	if($iType=='i_others'){if($this->isVO($item)){$keyname=(empty($item['name']))?('zz'.$keycnt):((string)$item['name']);$keycnt++;$iList['i_others'][$keyname]=$item;}}else if(!empty($iType)){$keyname=(empty($item['name']))?('zz'.$keycnt):((string)$item['name']);$keycnt++;$item['ihave']=false;if(in_array($item['name'], $this->myFranchise)){$item['ihave']=true;}$iList[$iType][$keyname]=$item;}
      }
      if(!empty($iDerivesFrom)){
      	foreach ($iDerivesFrom as $dItem){
      	  $d=(string)$dItem['derivesFrom'];
      	  foreach ($iList as $kitems=>$gitems){
      	  	if(isset($gitems[$d])){
      	  	  $item=$gitems[$d];
      	  	  $iType=$this->idxVT($item['type']);
      	  	  $keyname=(empty($dItem['name']))?('zz'.$keycnt):((string)$dItem['name']);
              $dItem['type']=$item['type'];
              $dItem['giftable']=$item['giftable'];
              $dItem['placeable']=$item['placeable'];
              $dItem['rareItem']=$item['rareItem'];
      	  	  if($iType=='i_others'){if($this->isVO($item)){$keycnt++;$iList['i_others'][$keyname]=$dItem;}}else{$keycnt++;$ditem['ihave']=false;if(in_array((string)$ditem['name'], $this->myFranchise)){$ditem['ihave']=true;}$iList[$iType][$keyname]=$dItem;}
      	  	}
      	  }
      	}
      }
      $this->allTypes='';
      $cntitem=0;
      foreach ($iList as $kitems=>$gitems){
        ksort($iList[$kitems]);
        if($kitems!='i_others'){
          if($kitems==$this->defaultsel){$this->allTypes .= "<option selected='selected' value='".$kitems."'>".$kitems."</option>";}else{$this->allTypes .= "<option value='".$kitems."'>".$kitems."</option>";}
          $this->allItems[$kitems]='';
          $snop="<optgroup label='NONE'><option class='bow' selected='selected' value='none'>none</option></optgroup>";
          if($kitems!='b_others'){$snop .= "<optgroup label='".strtoupper($kitems)."'>";}$curtype='';
          foreach($iList[$kitems] as $kitem=>$item){
            $iname=(string)$item['name'];
            $itype=(string)$item['type'];
            if(!in_array($iname, array('biz_lotsite_4x4','instant_ready_crop','supply_all_business','mark_all_business_ready'))&&(strpos($iname,'doober')==false)){if($kitems=='b_others'){if($itype!=$curtype){if(!empty($curtype)){$snop.="</optgroup>";}$snop.="<optgroup label='".strtoupper($itype)."'>";$curtype=$itype;}}$frname=$this->flN((string)$kitem);if(empty($frname)){$frname=(string)$kitem;}$fname=' - '.$frname;$soptid=($item['ihave']==true)?'t':'f';$soptid.=$cntitem;$snop.="<option id='".$soptid."' value='".$kitem.'|'.$frname."'>".$kitem.$fname."</option>";$cntitem++;}
          }
          $snop .= "</optgroup>";$this->allItems[$kitems]=$snop;
        }
      }
    }
    function GMN(){
      unset($this->myNeighbor);
      $this->myNeighbor=array();
      unset($this->arOrderedF);
      $this->arOrderedF=array();
      $this->myNeighbor[$this->ld->userId]='myCity';
      $qres=($this->ld->GetSelect('SELECT count(*) as cnt FROM sqlite_master where tbl_name="neighbors"'));
      if($qres[0]["cnt"]>=1){
        $qres=($this->ld->GetSelect('SELECT count(*) as cnt FROM neighbors'));
        if($qres[0]["cnt"]>0){
          $qres=($this->ld->GetSelect('SELECT value FROM neighbors'));
          foreach ($qres as $cver){
            $info=array();
            $info=@unserialize(base64_decode($cver['value']));
            if(!empty($info)&&is_array($info)){
              $nzuid=floatval(@$info['uid']);
              if(isset($info['uid'])&&!empty($info['uid'])){
              	$this->arOrderedF[''.$info['uid']]=array();
              	if(isset($info['cityname'])&&!empty($info['cityname'])){
              	  $this->myNeighbor[''.$info['uid']]=$info['cityname'];
              	}
              	else{
              	  $this->myNeighbor[''.$info['uid']]='unknownCity';
              	}
              }
            }
          }
          $this->ld->SavePlSettings('cityfranN', $this->myNeighbor);
        }
      }
    }
    function GN(){
      $nbs=array();
      $qres=($this->ld->GetSelect('SELECT count(*) as cnt FROM sqlite_master where tbl_name="neighbors"'));
      if($qres[0]["cnt"] >= 1){
        $qres=($this->ld->GetSelect('SELECT count(*) as cnt FROM neighbors'));
        if($qres[0]["cnt"] > 0){
          $qres=($this->ld->GetSelect('SELECT value FROM neighbors'));
          foreach ($qres as $cver){
            $info=array();
            $info=@unserialize(base64_decode($cver['value']));
            if(!empty($info)&&is_array($info)){
              $nzuid=floatval(@$info['uid']);
              if(isset($info['uid'])&&!empty($info['uid'])&&($nzuid > 9)){
                $nbs[]= array('zuid'=>(''.$info['uid']), 'cityname'=>(@$info['cityname']), 'row1'=>
		          '<td id="pad"><b>'.($info['uid']?(''.$info['uid']):'?').'</b><br />'.
				  (@$info['cityname']?$info['cityname']:'?').'</td>', 'row2'=>
				  '<td id="par"><b>Level: </b>'.(@$info['level']?$info['level']:'?').'<br />'.
				  '<b>XP: </b>'.(@$info['xp']?$info['xp']:'?').'<br />'.
				  '<b>Social: </b>'.(@$info['socialLevel']?$info['socialLevel']:'0').'/'.
				    (@$info['socialXp']?$info['socialXp']:'0').'<br />'.
				  '<b>Coins: </b>'.(@$info['gold']?$info['gold']:'?').'</td>',
				);
              }
            }
          }
        }
      }
      return $nbs;
    }
    function DN(){
      $nbs=$this->GN();
      echo '<table class="listtbl">'.
       '<tr class="rowtbl">'.
       '<th id="pam" width="1px">#</th>'.
       '<th id="pam">ZUID &amp; Name</th>'.
       '<th id="pam">Cityfran Item</th>'.
       '<th id="pam">Info</th>'.
       '</tr>';
      $cnt_zebra=0;
      foreach ($nbs as $line){
      	if(!empty($line)){
      	  (($cnt_zebra % 2)==0)?$clr_zebra='#DFFFF0':$clr_zebra='#CFFFE7';
      	  $sid=$line['zuid'];
      	  $stitle='Select only neighbors belonged to yourself.. ['.$sid.'] '.$line['cityname'];
      	  if(!empty($this->arOrderedF[$sid])){
      	  	$sford='<select id="ordneigh'.$sid.'" class="selford">';
      	  	foreach ($this->arOrderedF[$sid] as $orditem){
      	  	  $sford .= '<option disabled="disabled">'.$orditem.'</option>';
      	  	}
      	  	$sford .= '</select>';
      	  }
      	  else{ $sford='<select  class="selford"><option disabled="disabled">none</option></select>'; }
      	  $sselid='selneigh'.$sid;
      	  $stypid='typneigh'.$sid;
      	  $typsel='<select class="typeselect" id="'.$stypid.'">'.$this->allTypes.'</select>';
          $itemsel='<select class="neighselect" id="'.$sselid.'">'.$this->allItems[$this->defaultsel].'</select>';
          echo '<tr style="background-color:'.$clr_zebra.';border:thin solid black;" title="'.$stitle.'">'.
      	   '<td id="par">'.($cnt_zebra + 1).'</td>'.$line['row1'].'<td id="pad">'.$typsel.'&laquo;&nbsp;type<br />'.
           ''.$itemsel.'<br />'.$sford.'&laquo;&nbsp;already placed before</td>'.$line['row2'].'</tr>';
      	  $cnt_zebra++;
      	}
      }
      echo '</table>';
    }
    function GMF(){
      unset($this->myFranchise);
      $this->myFranchise=array();
      $qres=($this->ld->GetSelect('SELECT count(*) as cnt FROM sqlite_master where tbl_name="franchises"'));
      if($qres[0]["cnt"] >= 1){
        $qres=($this->ld->GetSelect('SELECT count(*) as cnt FROM franchises'));
        if($qres[0]["cnt"] > 0){
          $qres=($this->ld->GetSelect('SELECT value FROM franchises'));
          foreach ($qres as $cver){
            $info=@unserialize(base64_decode($cver['value']));
            $itemCode=''.$info['name'];
            $itemCfg=$this->iE($itemCode);
            if($itemCfg !== false){
              $itemType=(string)$itemCfg['type'];
              if(in_array($itemType, $this->validType)){
              	$this->myFranchise[]=(string)$itemCode;
              	if(isset($info['locations'])){if(is_array($info['locations'])&&!empty($info['locations'])){foreach($info['locations'] as $iuid=>$loc){$zuid=substr($iuid,1);$this->arOrderedF[$zuid][]=$itemCode;}}}
              }
            }
          }
        }
      }
    }
    function GF(){
      $arInfo=array();$frList=array();
      foreach ($this->validType as $vtype){$frList[$vtype]=array();}
      $frList['b_others']=array();
      $qres=($this->ld->GetSelect('SELECT count(*) as cnt FROM sqlite_master where tbl_name="franchises"'));
      if($qres[0]["cnt"] >= 1){
        $qres=($this->ld->GetSelect('SELECT count(*) as cnt FROM franchises'));
        if($qres[0]["cnt"] > 0){
          $qres=($this->ld->GetSelect('SELECT value FROM franchises'));
          foreach ($qres as $cver){
            $info=@unserialize(base64_decode($cver['value']));
            if(!empty($info)&&is_array($info)){$arInfo[$info['name']]=$info;}
          }
          ksort($arInfo);
          foreach ($arInfo as $info){
            $itemCode=''.$info['name'];
            $itemCfg=$this->iE($itemCode);
            if($itemCfg !== false){
              $itemType=(string)$itemCfg['type'];
              if(in_array($itemType, $this->validType)){$frList[$itemType][]=$info;}else if(in_array($itemType, $this->vtype_b)){$frList['b_others'][]=$info;}
            }
          }
        }
      }
      return $frList;
    }
    function DF(){
      $frlist=$this->GF();
      echo '<div id="tabfranchises" class="tabber">';
      foreach($frlist as $keyGroup=>$tGroup){
        echo '<div id="tabfr'.$keyGroup.'" class="tabbertab" title="'.$keyGroup.'">';
        echo '<table class="listtbl">'.
         '<tr class="rowtbl">'.
         '<th id="pam">No.</th>'.
         '<th id="pam">Franchise</th>'.
         '<th id="pam">Franchise Name</th>'.
	     '<th id="pam">Sub</th>'.
         '<th id="pam">Location ZUID</th>'.
         '<th id="pam">Location Name</th>'.
         '<th id="pam">Object ID</th>'.
         '<th id="pam">Star</th>'.
         '</tr>';      
        $cnt_zebra=0;
        $frCnt=0;
        foreach ($tGroup as $info){
          if(!empty($info)&&is_array($info)){
            (($cnt_zebra % 2)==0)?$clr_zebra='#DFFFF0':$clr_zebra='#CFFFE7';
      	    $stitle=$info['name'];
            echo '<tr style="background-color:'.$clr_zebra.';border:thin solid black;" title="'.$stitle.'">'.
		     '<td id="par"><b>'.($frCnt+1).'</b></td>'.
			 '<td id="pad"><b>'.($info['name']?('&nbsp;'.$info['name'].'&nbsp;'):'?').'</b></td>'.
			 '<td id="pad"><b>'.(@$info['franchise_name']?$info['franchise_name']:'').'</b></td>'.
			 '<td id="pad">&nbsp;</td>'.				 
			 '<td id="pad">&nbsp;</td>'.
			 '<td id="pad">&nbsp;</td>'.
			 '<td id="pad">&nbsp;</td>'.
			 '<td id="pad">&nbsp;</td>'.
			 '</tr>';
			$cnt_zebra++;
		    if(isset($info['locations'])){
		      if(is_array($info['locations'])&&!empty($info['locations'])){
			    $locCnt=0;
		        foreach($info['locations'] as $iuid=>$loc){
		          (($cnt_zebra%2)==0)?$clr_zebra='#DFFFF0':$clr_zebra='#CFFFE7';
		          $zuid=substr($iuid,1);
		          $ownername=@$this->nN(''.$zuid);
		          echo '<tr style="background-color:'.$clr_zebra.';border:thin solid black;" title="'.$stitle.'">'.
		           '<td id="par">&nbsp;</td>'.
				   '<td id="pad">'.(@$info['name']?('&nbsp;'.$info['name'].'&nbsp;'):'?').'</td>'.
				   '<td id="pad">'.(@$loc['franchise_name']?$loc['franchise_name']:'').'</td>'.
		           '<td id="par">'.($locCnt+1).'</td>'.
				   '<td id="pam">'.(@$iuid?$zuid:'').'</td>'.
				   '<td id="pad">'.$ownername.'</td>'.
				   '<td id="pam">'.(@$loc['obj_id']?$loc['obj_id']:'').'</td>'.
				   '<td id="pam">'.(@$loc['star_rating']?$loc['star_rating']:'').'</td>'.
				   '</tr>';
		      	  $cnt_zebra++;
		      	  $locCnt++;
		        }
		      }
		    }
            $frCnt++;
          }
      	}
      	echo '</table>';
      	if(empty($tGroup)){
       	  echo '<div class="bluewarning">&nbsp;You have no franchise of this type.</div>';
        }
      	echo '</div>';
      }
      echo '</div>';
    }
    function GetForm(){
	  $this->GMN();$this->GMF();$this->GAI();$this->fcndata=(array)$this->ld->GetPlSettings('cityfran');
  	  echo '<form><div class="quotation"><table class="darkbackginput" style="border:none;"><tr><td><span id="foauthornames" style="font-size:larger;">.</span>&nbsp;<span style="font-size:larger;font-weight:bold;">(v'.cityfran_VERSION.' - '.cityfran_DATE.')</span></td></tr><tr><td><span id="foquotes" style="font-size:smaller;">.</span>&nbsp;&nbsp;-&nbsp;&nbsp;<span style="font-size:smaller;">Links:&nbsp;&nbsp;</span><span style="font-size:normal;"><a class="blackwhite" href="'.base64_decode('aHR0cDovL3d3dy5hbGxib3RzLm9yZy9mb3J1bS92aWV3dG9waWMucGhwP2Y9MjgmdD0xMDAxMA==').'" target="_blank">&nbsp;plugin forum&nbsp;</a>&nbsp;&nbsp;<a class="blackwhite" href="'.base64_decode('aHR0cDovL3d3dy5hbGxib3RzLm9yZy9mb3J1bS92aWV3dG9waWMucGhwP2Y9MzAmdD01NjUx').'" target="_blank">&nbsp;bingav forum&nbsp;</a>&nbsp;&nbsp;</span></td></tr><tr><td>'.base64_decode('PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZTpzbWFsbGVyO2ZvbnQtd2VpZ2h0OmJvbGQ7Ij5CZSBjYXJlZnVsLCB1c2UgdGhpcyBzdWJwbHVnaW4gYXQgeW91ciBvd24gcmlzay48L3NwYW4+').'</td><tr></table></div><div width="100%" align="center"><br /><button class="btnnormal" id="btn_save">&nbsp;Save settings&nbsp;</button>&nbsp;<span id="fcnissaved" class="savedIndi">&nbsp;V&nbsp;</span>&nbsp;<span class="nprogress">&nbsp;</span></div><input type="checkbox" class="inputradio" id="cbfcnamerun" name="cbfcnamerun" value="true" /><label for="cbfcnamerun"> Run cityfran subplugin?</label><div id="tabmain0" class="tabber"><div id="tabsub0100" class="tabbertab" title="About - How to">';$this->A(); 
  	  echo '</div><div id="tabsub0101" class="tabbertab" title="Franchise List"><br /><span style="background-color:#000000;color:#FFFFFF;border:thin solid black;padding:4px;">List of your franchises:</span></b></span>&nbsp;&nbsp;';$this->DF();
  	  echo '</div><div id="tabsub0103" class="tabbertab" title="Select Neighbors &amp; Items">'.base64_decode('PGRpdiBjbGFzcz0icmVkd2FybmluZyI+KkJlIGNhcmVmdWwsIHNvbWUgaW5jb252ZW5pZW5jZSBpdGVtcyB3aWxsIGJyaW5nIG5laWdoYm9yYHMgY2l0eSBzdHVjay4mbmJzcDsqU2VsZWN0IG9ubHkgZHVtbXkgbmVpZ2hib3JzIGJlbG9uZ2VkIHRvIHlvdXJzZWxmLiZuYnNwOypJZiB5b3Ugc2VsZWN0IGl0ZW0geW91IGFscmVhZHkgcGxhY2VkIG9uIGEgbmVpZ2hib3JgcyBjaXR5LCB0aGVuIGF0dGVtcHRpbmcgdG8gcGxhY2Ugc2FtZSBpdGVtIGFnYWluIG9uIHRoZSBzYW1lIG5laWdoYm9yYHMgY2l0eSB3aWxsIHJlc3VsdCBpbiBlcnJvci4mbmJzcDsqQWx3YXlzIGFjY2VwdCBmcmFuY2hpc2UgZmlyc3QsIGJlZm9yZSB5b3UgcGxhY2UgYW5vdGhlciBzZWNvbmQgZnJhbmNoaXNlIHRvIHRoZSBzYW1lIG5laWdoYm9yLiZuYnNwOzwvZGl2Pg==').'<br /><span style="background-color:#000000;color:#FFFFFF;border:thin solid black;padding:4px;">Neighbors to receive franchise-orders:&nbsp;<b>Current selections: <span id="fcnCurItem">'.$this->fcndata['cntsel'].'</span></b></span>&nbsp;&nbsp;<button class="btnclear" id="btnfcnreset">Clear All Selections</button><br /><span class="redwarning" style="background-color:white;">&nbsp;(Limited to 10 neighbors per bot-cycle)&nbsp;</span><br />';$this->DN();
  	  echo '</div><div id="tabsub0102" class="tabbertab" title="Add New Types"><br /><span style="background-color:#000000;color:#FFFFFF;border:thin solid black;padding:4px;">When there is new type in the game, add it in here.</span></b></span>&nbsp;&nbsp;<div class="bluewarning"><br />New item types can be seen in the "<b>tmp_dir\gameSettings.xml</b>" file. Follow <b>plugin forum</b> to ask or read about new type in the game. (<b>Attention:</b> It is "item type" not "item name", e.g. business, residence, hotel, wonder..)</div><br /><input id="addtypes" type="text" value="" size="48" />&nbsp;&nbsp;<button class="btnaddtypes" id="btn_addtype">&nbsp;Add New Type&nbsp;</button>&nbsp;<br /><div class="bluewarning">&nbsp;After adding new type, please <b>refresh</b> this subplugin (Click <b>Refresh</b> button above).</div><br /><hr><div style="text-align:right;">Clicking on the button below will reset added types to the default types.<br /><button class="btnaddtypes" id="btn_resettype">Reset to Default</button></div><br />';
  	  echo '</div><div id="tabsub0104" class="tabbertab" title="Remove Franchise-Order"><br /><span style="background-color:#000000;color:#FFFFFF;border:thin solid black;padding:4px;">Run out franchise-order? Remove an existing order.</span></b></span>&nbsp;&nbsp;<div class="greenwarning"><br />(reserved, not implemented yet)</div></div></div><div width="100%" align="center"><br /><button class="btnnormal" id="btn_save1">&nbsp;Save settings&nbsp;</button>&nbsp;<span id="fcnissaved1" class="savedIndi">&nbsp;V&nbsp;</span></div><br /><hr></form>';
  	  echo '<script type="text/javascript">$(document).ready(function(){window.settings=eval('.json_encode($this->fcndata).');window.allitems=eval('.json_encode($this->allItems).');window.itemsel=new Object();var cntlimit=0;if((window.settings!==null)&&(window.settings!==undefined)){if(isNaN(window.settings.cntsel)){cntlimit=0}else{cntlimit=window.settings.cntsel}$("input:checkbox").each(function(){var scbid=false;var cbid=$(this).attr("id");if(cbid=="cbfcnamerun"){scbid=window.settings[cbid]}else{}if(scbid==true){$(this).attr("checked",true);$(this).addClass("checkedradio");$("label[for=\'"+cbid+"\']").addClass("boldtext")}else{$(this).attr("checked",false)}});if(window.settings.selitems){for(var nzuid in window.settings.selitems){var selid="selneigh"+nzuid;var typid="typneigh"+nzuid;var itemcode=window.settings.selitems[nzuid]["icode"];var itemtype=window.settings.selitems[nzuid]["itype"];var itemhave=window.settings.selitems[nzuid]["ihave"];if(($("#"+typid))&&($("#"+selid))){window.itemsel[nzuid]=new Object();window.itemsel[nzuid]["icode"]=itemcode;window.itemsel[nzuid]["itype"]=itemtype;window.itemsel[nzuid]["ihave"]=itemhave;$("#"+typid).val(itemtype).trigger("focusout");var select=$("#"+selid);$("option",select).remove();$("optgroup",select).remove();$("#"+selid).append(window.allitems[itemtype]);$("#"+selid).val(itemcode).trigger("focusout");$("#"+selid+" option").each(function(){if($(this).val()==itemcode){var ishave=$(this).attr("id");window.itemsel[nzuid]["ihave"]=ishave.substr(0,1);return false}})}}}}$(".inputradio").click(function(){var cbid=$(this).attr("id");if($(this).attr("checked")==true){$(this).addClass("checkedradio");$("label[for=\'"+cbid+"\']").addClass("boldtext")}else{$(this).removeClass("checkedradio");$("label[for=\'"+cbid+"\']").removeClass("boldtext")}$("#fcnissaved").html("&nbsp;X&nbsp;").removeClass().addClass("unsavedIndi");$("#fcnissaved1").html("&nbsp;X&nbsp;").removeClass().addClass("unsavedIndi")});$("button.btnaddtypes").hover(function(){$(this).removeClass().addClass("btnhover")},function(){$(this).removeClass().addClass("btnaddtypes")});$("#btn_addtype").click(function(){var req=new Object();req.newtype=$.trim($("#addtypes").val());data=$.toJSON(req);var l=window.location.toString();var indx=l.indexOf("?");var nurl=l.slice(0,indx)+"?action=saveNewTypes&tmp="+Math.random();$.post(nurl,data);return false});$("#btn_resettype").click(function(){var req=new Object();req.resettype="reset";data=$.toJSON(req);var l=window.location.toString();var indx=l.indexOf("?");var nurl=l.slice(0,indx)+"?action=resetTypes&tmp="+Math.random();$.post(nurl,data);return false});$("button.btnnormal").hover(function(){$(this).removeClass().addClass("btnhover")},function(){$(this).removeClass().addClass("btnnormal")});$("button.btnnormal").click(function(){var req=new Object();req.cbfcnamerun=false;req.selitems=new Object();var cntsel=0;$("input:checkbox").each(function(){var cbid=$(this).attr("id");if(cbid=="cbfcnamerun"){req.cbfcnamerun=$(this).attr("checked")}else{}});for(var nzuid in window.itemsel){if((window.itemsel[nzuid]["icode"]!="none")&&(window.itemsel[nzuid]["icode"]!="")){req.selitems[nzuid]=new Object();req.selitems[nzuid]["icode"]=window.itemsel[nzuid]["icode"];req.selitems[nzuid]["itype"]=window.itemsel[nzuid]["itype"];req.selitems[nzuid]["ihave"]=window.itemsel[nzuid]["ihave"];cntsel++}}req.cntsel=cntsel;$("#fcnCurItem").html(cntsel.toString());data=$.toJSON(req);var l=window.location.toString();var indx=l.indexOf("?");var nurl=l.slice(0,indx)+"?action=saveAll&tmp="+Math.random();$.post(nurl,data);$("#fcnissaved").html("&nbsp;V&nbsp;").removeClass().addClass("savedIndi");$("#fcnissaved1").html("&nbsp;V&nbsp;").removeClass().addClass("savedIndi");return false});$(".typeselect").change(function(){var selid=$(this).attr("id");var nzuid=selid.substr(8);var selid2="selneigh"+nzuid;var vtype=$(this).val();var select=$("#"+selid2);$("option",select).remove();$("optgroup",select).remove();$("#"+selid2).append(window.allitems[vtype]);$("#"+selid2).val("none").trigger("focusout")});$(".typeselect").keyup(function(){$(this).trigger("change")});$(".neighselect").change(function(){icodeselected=$(this).val();var selid=$(this).attr("id");var nzuid=selid.substr(8);var selid2="typneigh"+nzuid;var isdis=$("#"+selid+" option:selected").attr("disabled");var ishave=$("#"+selid+" option:selected").attr("id");if((cntlimit>=10)||(isdis==true)){icodeselected="none";$(this).val(icodeselected).trigger("focusout")}window.itemsel[nzuid]=new Object();window.itemsel[nzuid]["icode"]=icodeselected;window.itemsel[nzuid]["itype"]=$("#"+selid2).val();window.itemsel[nzuid]["ihave"]=ishave.substr(0,1);cntlimit=0;for(var nzuid in window.itemsel){if((window.itemsel[nzuid]["icode"]!="none")&&(window.itemsel[nzuid]["icode"]!="")){cntlimit++}}$("#fcnCurItem").html(cntlimit.toString());$("#fcnissaved").html("&nbsp;X&nbsp;").removeClass().addClass("unsavedIndi");$("#fcnissaved1").html("&nbsp;X&nbsp;").removeClass().addClass("unsavedIndi")});$(".neighselect").keyup(function(){$(this).trigger("change")});$("button.btnclear").hover(function(){$(this).removeClass().addClass("btnchover")},function(){$(this).removeClass().addClass("btnclear")});$("button.btnclear").click(function(){for(var nzuid in window.itemsel){$("#selneigh"+nzuid).val("none").trigger("focusout");window.itemsel[nzuid]["icode"]="none"}cntlimit=0;$("#fcnissaved").html("&nbsp;X&nbsp;").removeClass().addClass("unsavedIndi");$("#fcnissaved1").html("&nbsp;X&nbsp;").removeClass().addClass("unsavedIndi");$("#fcnCurItem").html("0")})});</script>';
    }
function A(){$txt=array('PGI+QXR0ZW50aW9uISBEbyBub3QgcnVuIGNpdHlmcmFuIGJlZm9yZSB5b3UgdW5kZXJzdGFuZCBiZWxvdyBleHBsYW5hdGlvbnMhIFBsZWFzZSByZWFkIGNhcmVmdWxseTo8L2I+','VGhpcyBwbHVnaW4gd2lsbCB0cnkgdG86IDxvbD48bGk+PGI+cmVnaXN0ZXI8L2I+IGEgbmV3IGZyYW5jaGlzZS1uYW1lIHdpdGggbm8gY29zdCBpZiBuZWNlc3NhcnksIDwvbGk+PGxpPjxiPnBsYWNlPC9iPiBmcmFuY2hpc2UgaXRlbSBvbnRvIG5laWdoYm9yYHMgY2l0eSwgaW4gb3JkZXIgdG8gZ2V0IGZyZWUgaXRlbXMuPC9vbD4=','Jm5ic3A7','PGI+Q3JlZGl0czogQmluZ2F2ICZhbXA7IG90aGVycyBpbnZvbHZlZCBpbiB0aGUgYmluZ2F2YHMgdGhyZWFkIGRpc2N1c3Npb24uPC9iPg==','VGhpcyBwbHVnaW4gaXMgaW1wbGVtZW50YXRpb24gb2YgQ2hhcmx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nRzIGRvIG5vdCBwYXkgYW55IGNvc3QuPC9pPjwvbGk+PC91bD48YnIgLz4=','SGFwcHkgZnJlZS1pdGVtcywgYXQgeW91ciBvd24gcmlzay4=','PGhyPg==',);echo '<br /><span style="background-color:#000000;color:#FFFFFF;border:thin solid black;padding:4px;">TRY to place franchise-items onto neighbor`s city (also register a new franchise name if necessary):</span>&nbsp;&nbsp;<table style="border:none;"><tr><td style="padding:4px;"><ul>';foreach($txt as $line){echo '<li style="padding:2px;">'.base64_decode($line).'</li>';}  echo '</ul></td></tr></table>';}}
class cfxmlsLang{var $langXML;function cfxmlsLang(){$langdir=substr($_SERVER["PHP_SELF"],0,strpos($_SERVER["PHP_SELF"],"/")).'tmp_dir\en_US.xml';$langs=simplexml_load_file($langdir);$arFname=array();foreach($langs->pkg as $pkg){if($pkg['name']=='Items'){foreach($pkg->string as $fname){$fkey=substr((string)$fname['key'],0,strpos((string)$fname['key'],'_friendlyName'));if(!empty($fkey)){$arFname[$fkey]=(string)$fname->original;}}}}$this->langXML=$arFname;}} ?>
